<template>
  <router-view />
</template>

<script setup>
import { ref, computed, provide, watchEffect, watch } from 'vue'
import useUserStore from './store/user'
const user = useUserStore()
const identity = user.user?.identity
const reload = () => {
  location.reload()
}

const isTea = ref(false)
const isStu = ref(false)

watch(
  () => user.user,
  () => {
    isStu.value = user.user?.identity == 2
    isTea.value = user.user?.identity == 3
  },
  { immediate: true, deep: true }
)
provide('isStu', isStu)
provide('isTea', isTea)
provide('reload', reload)
provide('identity', identity)
</script>

<style scoped lang="scss"></style>
